package com.henry.chatkit.chat

import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.RelativeLayout
import android.widget.TextView
import com.henry.chatkit.R
import com.henry.chatkit.input.InputLayout
import com.henry.chatkit.messages.MessageLayout

abstract class ChatLayoutUI : LinearLayout {

    lateinit var messageLayout: MessageLayout
    lateinit var inputLayout: InputLayout

    lateinit var mRecordingGroup: View
    lateinit var mRecordingIcon: ImageView
    lateinit var mRecordingTips: TextView

    lateinit var topLayout: RelativeLayout
    lateinit var bottomLayout: RelativeLayout

    constructor(context: Context?) : super(context) {
        initViews()
    }
    constructor(context: Context?, attrs: AttributeSet?) : super(context, attrs) {
        initViews()
    }
    constructor(context: Context?, attrs: AttributeSet?, defStyleAttr: Int) : super(
        context,
        attrs,
        defStyleAttr
    ) {
        initViews()
    }


    private fun initViews() {
        inflate(context, R.layout.chat_layout, this)
        messageLayout = findViewById(R.id.chat_message_layout)
        inputLayout = findViewById(R.id.chat_input_layout)

        mRecordingGroup = findViewById(R.id.voice_recording_view)
        mRecordingIcon = findViewById(R.id.recording_icon)
        mRecordingTips = findViewById(R.id.recording_tips)

        topLayout = findViewById(R.id.chat_top_layout)
        bottomLayout = findViewById(R.id.chat_bottom_layout)
    }
}